package com.frcdi.qms.table.service;

import com.frcdi.qms.table.domain.Field;
import com.frcdi.qms.table.mapper.TableMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @ClassName TableService
 * @Author Mr.Han
 * @Description //TODO 服务层调用$
 * @create 2024/5/27 11:13
 **/
@Service
public class TableService {

    @Autowired
    private TableMapper tableMapper;

    public List<String> findTableNames(String pattern) {
        return tableMapper.getTableNamesLike(pattern);
    }

    public List<String> getFieldsByTableName(String tableName) {
        return tableMapper.getColumnNamesForTable(tableName);
    }

    public List<String> getDataByTableAndField(Field field) {
        return tableMapper.selectDataByTableAndField(field);
    }
}
